<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%address}}".
 *
 * @property string $addressid
 * @property string $firstname
 * @property string $lastname
 * @property string $company
 * @property string $address
 * @property string $postcode
 * @property string $email
 * @property string $telephone
 * @property string $userid
 * @property string $createtime
 */
class Address extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public $addressDetail;//详细地址，第二个输入框,与address拼接后形成详细地址
    public static function tableName()
    {
        return '{{%address}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['address'], 'string'],
            [['postcode'], 'required'],
            [['userid', 'createtime'], 'integer'],
            [['firstname', 'lastname'], 'string', 'max' => 32],
            [['company', 'email'], 'string', 'max' => 100],
            [['postcode'], 'string', 'max' => 6],
            [['telephone'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'addressid' => 'Addressid',
            'firstname' => '姓*',
            'lastname' => '名*',
            'company' => '公司名称',
            'address' => '地址*',
            'addressDetail'=>'*',
            'postcode' => '邮编*',
            'email' => '电子邮箱地址*',
            'telephone' => '联系电话*',
            'userid' => '用户ID',
            'createtime' => 'Createtime',
        ];
    }
}
